#include <stdio.h>

#define STLEN 10

int main(void)
{
    char words[STLEN];
    int i;

    puts("Enter strings (empty line to quit): ");
    while (fgets(words, STLEN, stdin) != NULL && words[0] != '\n')
    {
        while (words[i] != '\n' && words[i] != '\0')
            i++;
        
        if (words[i] == '\n')
            words[i] = '\0';
        else //word[i] == '\0' 执行
        {
            while (getchar() != '\n')
                continue;
        }
        puts(words);

        puts("Enter strings (empty line to quit): ");
    }
    puts("Done!");

    return 0;
}